Documentation for class sound

Inherits from 	complex_object 

Properties declared in sound 

Class Methods declared in sound 
	beep 
	is_muted 
	new 
	new_from_file(path) 
	play_sound_file(path) 
	set_mute(boolean) 
	set_volume(number) 
	volume 

Methods declared in sound 
	action 
		erase 
		pause 
		play 
		record 
		resume 
		stop 
		write_to_pasteboard 
	any 
		duplicate 
		erase 
		inspect 
		is_editable 
		is_empty 
		pause 
		play 
		record 
		rename(name) 
		resume 
		stop 
		write_to_file(string) 
		write_to_pasteboard 

Class 
#begin_class
sound 
The class sound is a sub-class of the class complex_object. 
A sound object knows how to record and play-back sound.
The sound class understands messages to set the volume and mute parameters of the computer.
To create a new sound in CraftMan, use the appearance aspect of the program inspector.
#end_class

Properties 

Methods 

#begin_method
duplicate 
Returns a new sound object that is a copy of the sound. 
Note: The system sounds cannot be duplicated. They return self.
#end_method

#begin_method
erase 
Removes the sound form the sound object.
Returns self.
#end_method

#begin_method
inspect 
Opens the inspector for the sound object.
Returns self.
#end_method

#begin_method
is_editable 
Returns true if the sound may be edited.
#end_method

#begin_method
is_empty 
Returns true if the sound object has no sound.
#end_method

#begin_method
pause 
Stops the playback of the sound. To continue the sound, send the resume message to the sound object.
Returns self.
#end_method

#begin_method
play 
Starts the playback of the sound object.
Returns self.
#end_method

#begin_method
record 
Starts the recording of the sound object.
Returns self.
#end_method

#begin_method
rename(name) 
Sets the name of the sound object to the symbol name.
Ex:
s := {sound}:new
s:rename(#my_sound)
The sound s can now also be referred to as
{sound my_sound}
#end_method

#begin_method
resume 
Continues playback that has been stopped by a pause message.
Returns self.
#end_method

#begin_method
stop 
Stops playback or recording if in progress.
#end_method

#begin_method
write_to_file(string) 
Writes the sound of the sound object to the file string. If string is not a complete filename the file will be placed in the home directory.
Returns true if the writing was successful. Otherwise the method returns false.
#end_method

#begin_method
write_to_pasteboard 
Stores the sound of the sound object in the pasteboard.
Returns self.
#end_method

Class Methods 

#begin_class_method
beep 
Plays the system beep.
Returns self.
#end_class_method

#begin_class_method
is_muted 
Returns true if the computer is muted.
#end_class_method

#begin_class_method
new 
Returns a new empty sound object.
#end_class_method

#begin_class_method
new_from_file(path) 
Returns a new sound object with the sound from the file path.
#end_class_method

#begin_class_method
play_sound_file(path) 
Plays the sound-file path. The sound is never loaded into the program.
Note: This is a good way to save disk space. The sounds can be stored anywhere on disk and several programs can share the same sounds. 
Returns self.
#end_class_method

#begin_class_method
set_mute(boolean) 
Set the mute of the computer to boolean.
Returns self.
#end_class_method

#begin_class_method
set_volume(number) 
Set the volume of the computer's built-in speaker to number. Number should be between 0.0 (silence) and 1.0 (loud).
Returns self.
#end_class_method

#begin_class_method
volume 
Returns the volume of the computer's built-in speaker. The value is between 0.0 (silence) and 1.0 (loud).
#end_class_method